package com.example.showdomilhao;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.example.model.Pergunta;

public class MenuInicial extends Activity {
	
	private Button btnIniciarJogo;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu_inicial);
		
		btnIniciarJogo = (Button) findViewById(R.id.btnIniciarJogo);
		
		// create click listener
	     OnClickListener oclBtnOk = new OnClickListener() {
	       @Override
	       public void onClick(View v) {
	    	   Intent i = new Intent();
	    	   i.putExtra("pergunta", Pergunta.sortearPergunta(1));
               i.setClass(MenuInicial.this,ExibirPergunta.class);
               startActivity(i);
	       }
	     };
	     
	     
	     btnIniciarJogo.setOnClickListener(oclBtnOk);
	   }
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
}